﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Mvc4Demo.Core;
using MvcExtensions.Attributes;

namespace Mvc4Demo.Models
{
    public class TestViewModel
    {
        public int Id { get; set; }

        public string Name { get; set; }

        [DataType(DataType.Date)]
        [Display(Description = "Date of birth")]
        [ClientValidate("DOB")]
        public DateTime DOB { get; set; }

        public string Address { get; set; }

        [ServiceLookup( LookupType = typeof(LookupService), MethodName = "GetUserTypes")]
        public string PersonType { get; set; }

        [LookupText(LookupIdPropertyName = "PersonType")]
        public string PersonTypeText { get; set; }

        public AddressViewModel AddressViewModel { get; set; }

        public IEnumerable<SalaryViewModel> Salaries { get; set; } 
    }

    public class SalaryViewModel
    {
        public int Id { get; set; }

        public DateTime Date { get; set; }

        public decimal Amount { get; set; }

        public bool Active { get; set; }
    }

    public class AddressViewModel
    {
        public int Id { get; set; }

        public string AddressLine1 { get; set; }
        public string AddressLine2 { get; set; }
        public string AddressLine3 { get; set; }
        public string County { get; set; }
        public string Postcode { get; set; }

    }
}